package com.java.bean;

import java.util.Objects;

/**
 * @Author: wjr
 * @Description: 用户实体类对象
 * @Date Created in  2020-09-03 11:50
 * @Modified By:
 */
public class User {
    private String userName;
    private String passWord;
    private int num;//积分 初始值120
    private boolean isRep;//是否可以评论 初始值false

    public User() {
    }

    public User(String userName, String passWord, int num, boolean isRep) {
        this.userName = userName;
        this.passWord = passWord;
        this.num = num;
        this.isRep = isRep;
    }

    @Override
    public String toString() {
        return "User{" +
                "userName='" + userName + '\'' +
                ", passWord='" + passWord + '\'' +
                ", num=" + num +
                ", isRep=" + isRep +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return num == user.num &&
                isRep == user.isRep &&
                Objects.equals(userName, user.userName) &&
                Objects.equals(passWord, user.passWord);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userName, passWord, num, isRep);
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public boolean isRep() {
        return isRep;
    }

    public void setRep(boolean rep) {
        isRep = rep;
    }
}
